package org.jupiter.blog.service.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jupiter.blog.api.domain.JupiterTag;

import java.util.List;

@Mapper
public interface JupiterTagMapper {

	int insert(JupiterTag tag);

	JupiterTag selectByUuid(@Param("uuid") String uuid);

	List<JupiterTag> selectAll();

	int updateByUuidSelective(JupiterTag tag);

	int deleteByUuid(@Param("uuid") String uuid);

	List<JupiterTag> selectByPage(
		@Param("name") String name,
		@Param("color") String color,
		@Param("isActive") Boolean isActive,
		@Param("offset") int offset,
		@Param("limit") int limit
	);

	long countByQuery(
		@Param("name") String name,
		@Param("color") String color,
		@Param("isActive") Boolean isActive
	);

	List<JupiterTag> selectActiveTags();

	List<JupiterTag> selectByArticleId(@Param("articleId") String articleId);
}
